package com.itheima.web;

import com.itheima.pojo.Brand;
import com.itheima.service.BrandService;
import com.itheima.service.BrandServiceImpl;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

import javax.sql.DataSource;
import java.util.List;

public class Test {
    public static void main(String[] args) {


//        ApplicationContext context = new ClassPathXmlApplicationContext("ApplicationContext.xml");
//        BrandServiceImpl dao = (BrandServiceImpl) context.getBean("brandService");
//        dao.A();
        AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext(Test2.class);
        BrandService bean = context.getBean(BrandService.class);
        System.out.println(bean.selectAll());


    }
}
